package com.flyduck.vueshop.product.feign;

import com.flyduck.vueshop.common.core.lang.Result;
import com.flyduck.vueshop.product.fallback.RemoteProductFallback;
import com.flyduck.vueshop.product.vo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * <p>
 * RemoteSkuStockFeignClient
 * </p>
 *
 * @author flyduck
 * @since 2024-07-15
 */
@FeignClient(name = "vueshop-service-product",contextId = "remoteProductFeignClient",fallback = RemoteProductFallback.class)
public interface RemoteProductFeignClient {

    @PostMapping("/product/remote/product/getProductById/{id}")
    Result<RemoteProductRespVO> getProductById(@PathVariable("id") Long id);

    @GetMapping("/product/remote/product/getOnSaleProductList")
    Result<List<RemoteProductRespVO>> getOnSaleProductList();

    @GetMapping("/product/remote/product/batchUpdateProduct")
    Result<Void> batchUpdateProduct(@RequestBody List<RemoteProductUpdateReqVO> remoteProductUpdateReqVOList);
}
